Skip to content

docs: migrate to DocumenterVitepress + docstring audit#355

Open
ocots wants to merge 1 commit into
mainfrom
docs/vitepress-migration
Open

docs: migrate to DocumenterVitepress + docstring audit#355
ocots wants to merge 1 commit into
mainfrom
docs/vitepress-migration

Conversation

@ocots

@ocots ocots commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

Migrates the CTModels.jl documentation to DocumenterVitepress, following the pattern established in CTBase.jl. Also includes a full docstring audit of all public symbols.


Documentation infrastructure

  • docs/Project.toml: add DocumenterVitepress, LiveServer
  • docs/make.jl: switch to MarkdownVitepress format; new navigation structure; deploydocs guarded by bases.txt
  • docs/api_reference.jl: refactor to CTBase pattern — modules_config loop for public pages, one unified Internals page, subdirectory="api"
  • .github/workflows/Documentation.yml: restrict deployment trigger to stable version tags (v[0-9]+\.[0-9]+\.[0-9]+)
  • docs/src/.vitepress/config.mts: inject explicit nav array + remote CT CSS/JS assets (generated by DocumenterVitepress.generate_template)

Guides

  • docs/src/getting-started.md: new entry-point guide (installation, mental model, 5-minute walkthrough for OCP building, solution assembly, initial guess)
  • docs/src/index.md: fix module overview table (was referencing non-existent CTModels.OCP)
  • docs/src/model/index.md: fix layer table + add text language to ASCII pipeline diagram
  • docs/src/model/components.md: fix broken reference to non-existent OCP/Validation/ path
  • docs/src/model/types_and_traits.md: replace broken local philosophy link with Handbook reference
  • docs/src/serialization/index.md: rename page to "Extensions"; add text language to dispatch diagram

Docstring audit

Root cause fixed throughout: all julia-repl examples used unqualified calls (PreModel(), state!(), etc.) that would fail at the REPL since CTModels has no top-level exports. All examples now use CTModels.* qualified calls.

Additional fixes per file:

File Fix
Building/dynamics.jl Replace non-standard # Preconditions/# Behavior sections with # Returns/# Throws; remove examples with wrong API signatures
Building/time_dependence.jl Fix invalid \dot escape → \\dot; standardize sections
Building/constraints.jl Fix __constraint! example (wrong type Dict()ConstraintsDictType(), mismatched lb/ub dimensions)
Building/build.jl Replace two examples using old/wrong API (times!, non-in-place dynamics!) with correct qualified workflow
Building/objective.jl Add full setup context to example
Building/times.jl Add missing variable! prerequisite to free-time examples
Solutions/build_solution.jl Qualify time_grid examples; remove non-standard # Behavior section
Solutions/solution_types.jl Qualify MultipleTimeGridModel constructor example; remove non-standard # Behavior section
ext/CTModelsJLD.jl Qualify export_ocp_solution/import_ocp_solution examples
ext/CTModelsJSON.jl Same as above

- docs/Project.toml: add DocumenterVitepress, LiveServer
- docs/make.jl: switch to MarkdownVitepress format, new nav, bases.txt guard
- docs/api_reference.jl: refactor to CTBase pattern (modules_config loop,
  unified Internals page, subdirectory="api")
- .github/workflows/Documentation.yml: restrict to stable version tags
- docs/src/.vitepress/config.mts: inject nav array + CT remote CSS/JS assets
- docs/src/getting-started.md: new guide (install, mental model, walkthrough)
- docs/src/index.md: fix module overview table
- docs/src/model/index.md: fix layer table + add text fence language
- docs/src/model/components.md: fix broken OCP/Validation/ reference
- docs/src/model/types_and_traits.md: fix broken philosophy link
- docs/src/serialization/index.md: rename to Extensions, add text fence

Docstring audit (qualify all julia-repl examples, standardize sections):
- Building/state.jl, control.jl, variable.jl, times.jl, objective.jl
- Building/dynamics.jl: replace non-standard sections, clean up examples
- Building/time_dependence.jl: fix backslash escape, standardize sections
- Building/constraints.jl, build.jl: fix wrong API signatures in examples
- Building/name_validation.jl: qualify private function examples
- Solutions/build_solution.jl, solution_types.jl: qualify time_grid examples
- ext/CTModelsJLD.jl, CTModelsJSON.jl: qualify export/import examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant